@import "../ea-ui-base-style.scss";

.ea-image_wrap {
  align-content: center;
  text-align: center;
  &.is-error {
    background-color: #f5f7fa;
    svg {
      width: 20px;
      height: 20px;
    }
  }

  img {
    position: relative;
    width: 100%;
    height: 100%;

    user-zoom: scale;

    object-fit: cover;
    transition: rotate 0.3s, scale 0.3s;
  }

  .ea-image_preview-wrap {
    position: fixed;
    top: 0;
    left: 0;

    width: 100%;
    height: 100%;

    z-index: 999;

    opacity: 0;
    transform: translateY(-1rem);
    transition: opacity 0.3s, transform 0.3s;
    background-color: rgba(0, 0, 0, 0.4);

    &.entry {
      opacity: 1;
      transform: translateY(0);
    }

    .ea-icon-close {
      position: absolute;
      right: 40px;
      top: 40px;

      cursor: pointer;
      width: 40px;
      height: 40px;

      font-size: 24px;
      line-height: 36px;
      border-radius: 50%;
      color: #fff;
      background-color: #606266;
      text-align: center;
    }

    img {
      width: 100%;
      height: 100%;

      object-fit: contain;
    }
  }

  .ea-image_preview-tools {
    display: flex;
    align-items: center;
    justify-content: space-around;

    position: absolute;
    bottom: 20px;
    left: 50%;

    padding: 0.5rem 1rem;

    user-select: none;

    border-radius: 999px;

    transform: translateX(-50%);

    background-color: #60626691;
    color: #fff;

    .ea-icon-zoom,
    .ea-icon-rotate {
      width: 2rem;
      text-align: center;
      cursor: pointer;

      margin: 0 1rem;
    }

    .ea-icon-zoom {
      font-size: 2rem;
    }

    .ea-icon-zoom-in {
      font-size: 1.75rem;
    }

    .ea-icon-rotate {
      font-size: 1.5rem;
    }
  }
}
